<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        function jieChengJia(num) {
            var sum1 = 0
            for (var i = 1; i <= num; i++) {
                var sum2 = 1
                for (var j = i; j > 0; j--) {
                    sum2 *= j
                }
            sum1 += sum2

            }
            alert(sum1)
        }

        var num = parseInt(prompt("请输入一个整数"))
        jieChengJia(num)
    </script>
</head>

<body>

</body>

</html>